package HomeWork;

public class Test01 {
    public static void main(String[] args) {
        Employee yuangong=new Employee("01","a",18,1000);
        yuangong.getInfo();
        Programmer chengxuyuan=new Programmer("02","b",30,10000);
        chengxuyuan.getInfo();
        Designer shejishi=new Designer("03","c",25,50000,1000000);
        shejishi.getInfo();
        Architect jiagoushi=new Architect("03","c",25,20000,0.40);
        jiagoushi.getInfo();
    }
}
class Employee{
    public String num;
    public String name;
    public int age;
    public int money;
    //构造

    public Employee(String num, String name, int age, int money) {
        this.num = num;
        this.name = name;
        this.age = age;
        this.money = money;
    }

    public Employee() {
    }

    public void getInfo(){
        System.out.println("编号为："+num+"姓名为："+name+"年龄为："+age+"薪资为："+money);
    }
}
class Programmer extends Employee{
    public String speak="Java";

    public Programmer(String num, String name, int age, int money) {
        super(num, name, age, money);
    }

    public Programmer() {
    }
    @Override
    public void getInfo(){
        System.out.println("编号为："+num+"姓名为："+name+"年龄为："+age+"薪资为："+money+"语言为："+speak);
    }
}
class Designer extends Employee{
    public int bonus;

    public Designer(String num, String name, int age, int money, int bonus) {
        super(num, name, age, money);
        this.bonus = bonus;
    }

    public Designer() {
    }
    @Override
    public void getInfo(){
        System.out.println("编号为："+num+"姓名为："+name+"年龄为："+age+"薪资为："+money+"奖金为："+bonus);
    }
}
class Architect extends Employee{
    public double gupiao;

    public Architect(String num, String name, int age, int money, double gupiao) {
        super(num, name, age, money);
        this.gupiao = gupiao;
    }

    public Architect() {
    }
    @Override
    public void getInfo(){
        System.out.println("编号为："+num+"姓名为："+name+"年龄为："+age+"薪资为："+money+"股票为："+gupiao);
    }
}